<?php include( "require config.php" );

$results = array();
$results = Result::getByEvent( $_POST['id'] ); ?>
<html>
	<body>
		<table>
  <?php
    foreach ( $results['results'] as $result ) {
  ?>
      <tr>
        <td width="40%">
        <?php
          if ( isset( $result->home_team ) ) {
            echo( htmlspecialchars( $result->home_team ) );
          }
        ?>
        </td>
        <td width="10%">
        <?php
          if ( isset( $result->home_score ) ) {
            echo( htmlspecialchars( $result->home_score ) );
          }
        ?>
        </td>
        <td width="10%">
        <?php
          if ( isset( $result->away_score ) ) {
            echo( htmlspecialchars( $result->away_score ) );
          }
        ?>
        </td>
        <td width="40%">
        <?php
          if ( isset( $result->away_team ) ) {
            echo( htmlspecialchars( $result->away_team ) );
          }
        ?>
        </td>
      </tr>
  <?php
    }
  ?>
</table>
</body>
</html>

